package com.jec.module.sysmonitor.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by jeremyliu on 5/10/16.
 */
@Entity
@Table(name="zhwg_terminal_device")
public class TerminalDevice implements Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = -7723856795509022782L;

	@Id
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment",strategy="increment")
	@Setter @Getter
    private int id;

    @Column(name="element_id")
    @Setter @Getter
    private int netUnitId;

    @Setter @Getter
    private String name;

    @Setter @Getter
    @Column(name="code")
    private String code;
    
    @Setter @Getter
    private String location = "";
    
    @Setter @Getter
    private String category = "bgzh1";
    
    @OneToMany(targetEntity = DevicePort.class, mappedBy = "deviceId")
    @JsonIgnore
    @Setter @Getter
    private List<DevicePort> ports = new ArrayList<>();

}
